import { OpenAIFilled } from "@ant-design/icons";
import React from "react";

// 环境变量配置
const FLOWISE_BASE_URL = process.env.REACT_APP_FLOWISE_BASE_URL || "http://localhost:3000";
const FLOWISE_API_KEY = process.env.REACT_APP_FLOWISE_API_KEY || "";
const CONSTANTS_FLOW_ID = process.env.REACT_APP_CONSTANTS_FLOW_ID || "";

export const getMockSuggestions = (t: any) => [
  { label: t('chatbox.suggestions.report'), value: "report" },
  { label: t('chatbox.suggestions.draw'), value: "draw" },
  {
    label: t('chatbox.suggestions.knowledge'),
    value: "knowledge",
    icon: React.createElement(OpenAIFilled),
    children: [
      { label: t('chatbox.suggestions.react'), value: "react" },
      { label: t('chatbox.suggestions.antd'), value: "antd" },
    ],
  },
];

export const API_CONFIG = {
  FLOW_ID: CONSTANTS_FLOW_ID,
  BASE_URL: `${FLOWISE_BASE_URL}/api/v1/prediction`,
  ABORT_URL: `${FLOWISE_BASE_URL}/api/v1/chatmessage/abort`,
  API_KEY: FLOWISE_API_KEY,
};
